<template>
  <div class="">
    <van-nav-bar
      title="标题"
      left-text="返回"
      left-arrow
      @click-left="$router.go(-1)"
    />

    <div v-for="item in info" :key="item.houseCode">
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item><img :src="item.houseImg" alt="" /></van-swipe-item>
      </van-swipe>
    </div>

    <!-- 自定义图标 -->
    <van-tabbar v-model="active">
      <van-tabbar-item icon="star-o">
        <span>收藏</span>
      </van-tabbar-item>
      <van-tabbar-item icon="0">在线咨询</van-tabbar-item>
      <van-tabbar-item icon="0">电话预约</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
// 引入axios
import axios from 'axios'

export default {
  name: 'ConTent',
  props: {},
  components: {},
  data () {
    return {
      info: null,
      active: 0,
      icon: {
        active: 'https://img01.yzcdn.cn/vant/user-active.png',
        inactive: 'https://img01.yzcdn.cn/vant/user-inactive.png'
      }
    }
  },

  // 在created钩子中发起请求
  async created () {
    const id = this.$route.query.houseCode

    const { data } = await axios({
      url: 'https://mock.boxuegu.com/mock/3083/articles/' + id
    })

    console.log(data)
    this.info = data.body.list
  }
}
</script>
<style scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>
